load("@fbsource//tools/build_defs/android:robolectric4_test.bzl", "robolectric4_test")
load("//fbandroid/libraries/profilo/java/test:JNI_DEPS.bzl", "JNI_DEPS")
load("//tools/build_defs/android:fb_core_android_library.bzl", "fb_core_android_library")
load("//tools/build_defs/oss:profilo_defs.bzl", "profilo_path")

UTIL_CLASSES = ["TraceOrchestratorTestHelper.java"]

robolectric4_test(
    name = "core",
    srcs = glob(
        ["*.java"],
        exclude = UTIL_CLASSES,
    ),
    autoglob = False,
    contacts = ["oncall+loom@xmail.facebook.com"],
    jni_deps = JNI_DEPS,
    language = "JAVA",
    deps = [
        "//fbandroid/java/com/facebook/testing/inject:inject",
        "//fbandroid/java/com/facebook/testing/util:util",
        profilo_path("deps/fbtrace:utils"),
        profilo_path("deps/jsr-305:jsr-305"),
        profilo_path("deps/soloader:soloader"),
        profilo_path("java/main/com/facebook/profilo/core:core"),
        profilo_path("java/main/com/facebook/profilo/writer:writer"),
        profilo_path("java/test/com/facebook/profilo/logger:utils"),
        profilo_path("java/test/com/facebook/profilo/util:util"),
        "//fbandroid/third-party/java/assertj:assertj-android",
        "//fbandroid/third-party/java/assertj:assertj-core",
        "//fbandroid/third-party/java/fest:fest",
        "//fbandroid/third-party/java/guava:guava",
        "//fbandroid/third-party/java/junit:junit",
    ],
)

fb_core_android_library(
    name = "util",
    srcs = UTIL_CLASSES,
    visibility = [
        "PUBLIC",
    ],
    deps = [
        profilo_path("java/main/com/facebook/profilo/core:core"),
    ],
)
